set timespec to UTC in new skytraq code. (#1094)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 28 Apr 2023 21:37:54 +0000 (15:37 -0600)
committerGitHub <noreply@github.com>
Fri, 28 Apr 2023 21:37:54 +0000 (15:37 -0600)
I wish Qt would default to UTC instead of Local Time!

skytraq.cc

index a228e6e65e38dc595ff6addba7e5f590bf75c929..239c18bfa8dc16def42363838390c6407ef50586 100644 (file)
@@ -531,7 +531,7 @@ SkytraqBase::gpstime_to_qdatetime(int week, int sec) const
   int override = xstrtoi(opt_gps_utc_offset, nullptr, 10);
   if (override) {
     gps_timet -= override;
-    return QDateTime::fromSecsSinceEpoch(gps_timet);
+    return QDateTime::fromSecsSinceEpoch(gps_timet, Qt::UTC);
   }
 
   /* leap second compensation: */
@@ -554,7 +554,7 @@ SkytraqBase::gpstime_to_qdatetime(int week, int sec) const
   // Future: Consult http://maia.usno.navy.mil/ser7/tai-utc.dat
   // use http://www.stevegs.com/utils/jd_calc/ for Julian to UNIX sec
 
-  return QDateTime::fromSecsSinceEpoch(gps_timet);     /* returns UTC time */
+  return QDateTime::fromSecsSinceEpoch(gps_timet, Qt::UTC);
 }
 
 void